<template>
	<view>
     <view v-if="nodata"> 暂无数据 </view>
     <view>
       <view>
         统计日期：{{obj.date}}
       </view>
       <view>
         每单金额：{{obj.dayBonus}}
       </view>
       <view>
         下单数量:{{obj.placeOrder}} 
       </view>
       <view>
         收货数量:{{obj.takeDelivery}}
       </view>
       <view>
         分红总金额:{{obj.totalAmount}}
       </view>
       <view>
        分红人数:{{obj.dayBonusUserNum}}
       </view>
       <view>
         每人分红金额:{{obj.userAmount}}
       </view>
     </view>
<!--<view v-if="higherLevelUser.nickName">我的上级推荐人: 账号:{{higherLevelUser.nickName}} 真实姓名:{{higherLevelUser.realName}}</view>
    <span>我的下级推荐人↓</span>
    <div class="container">
      <view v-if="treeData.length>0" v-for="(item,index) in treeData" :key="index">
        <view class="flex">
           <view>{{item.name}}</view> <view class="bnt" @click="viewOrder(item.id)">查看订单</view>
        </view>
         <view v-if="item.children" v-for="(item1,index1) in item.children" :key="index1"  style="padding-left: 50rpx;">
           <view class="flex">
              <view>{{item1.name}}</view> <view class="bnt" @click="viewOrder(item.id)">查看订单</view>
           </view>
           <view v-for="(item2,index2) in item1.children" v-if="item1.children"  :key="index2"   class="flex" style="padding-left: 100rpx;">
              <view>{{item2.name}}</view> <view class="bnt" @click="viewOrder(item.id)">查看订单</view>
           </view>
         </view>
      </view>
    </div> -->
	</view>
</template>

<script setup>
import { onLoad } from '@dcloudio/uni-app';
import { onMounted } from 'vue';
  // import TreeChart from "vue-tree-chart-3";
// const treeData =ref([])
// const higherLevelUser = ref({});
const nodata=ref(false)
const obj=ref({})
  onShow(() => {
    viewOrder()
    // http.request({
    //   url: '/p/user/getLowerLevel',
    //   method: 'GET',
    //   data: {}
    // })
    //   .then(({ data }) => {
    //     higherLevelUser.value = data.higherLevelUser
    //     treeData.value=data.lowerLevelUser
    //   })
  })
const viewOrder =()=>{
  // uni.navigateTo({
  //   url:"/pages/user/distCenter/orderlist?id="+id
  // })
  http.request({
    url: '/p/oneLevelDistribution/getDayBonus',
    method: 'GET',
    data: {}
  })
  .then(({ data }) => {
      console.log(data)
      obj.value=data
     })
    
}

</script>

<style >
  .flex{
    display: flex;
    justify-content:space-between;
    align-items: center;
    margin-top: 10px;
  }
  .bnt{
    padding: 6rpx 12rpx;
    border-radius: 20rpx;
    background-color:skyblue;
    color: #fff;
    font-size: 25rpx;
  }
  .container {
    padding:30rpx 50rpx ;
  }

</style>
